package com.itheima.fanxing;

import java.util.ArrayList;

/*
自定义泛型方法
 */
public class Demo05 {

    public static void main(String[] args) {
        String s="吴亦凡";
        sing1(s);
        ArrayList<String> list = sing2(s);
        System.out.println(list);
        int i=10;
        ArrayList<Integer> list1 = sing2(i);
        System.out.println(list1);

    }
    public static <T> void sing1(T t){
        System.out.println(t);

    }

    public static <T> ArrayList<T> sing2(T t){
        System.out.println(t);
        ArrayList<T> list = new ArrayList<>();
        list.add(t);
        list.add(t);
        list.add(t);
        list.add(t);
        return list;
    }
}
